package com.aliyun.heiyu.powermaster.server.rotary.dao.impl;

import com.aliyun.heiyu.powermaster.server.rotary.dao.IpcDAO;
import com.aliyun.heiyu.powermaster.server.rotary.utils.JdbcUtil;

import java.util.Map;

/**
 * @Description 工控机实现
 * @Author shun.zhang
 * @Date 2020/9/2 13:47
 **/
public class IpcDAOImpl implements IpcDAO {
    /**
     * 查询工控机信息
     *
     * @return
     */
    @Override
    public Map<String, String> queryIpc() {
        String sql = "SELECT com.ip ip,ipc.i_port port,ipc.agreement from device_common com left join d_ipc ipc on com.device_id = ipc.device_id where com.type = 'ipc' and com.status = 1 order by com.create_time desc limit 1";
        return JdbcUtil.queryForMap(sql,null);
    }
}
